﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace linkouqs.Gamekit {

    public sealed class Movebox : PushableObject {

        BoxCollider2D triggerBoxCollider2D;

        protected override void Awake() {
            base.Awake();

            triggerBoxCollider2D = trigger.GetComponent<BoxCollider2D>();
        }


        public override void OnStartPush(CharacterAbilityPush user) {
            base.OnStartPush(user);

            if(triggerBoxCollider2D != null) {
                var s = triggerBoxCollider2D.size;
                s.x = 1f;
                triggerBoxCollider2D.size = s;
            }
        }

        public override void OnStopPush() {
            base.OnStopPush();
            
            if(triggerBoxCollider2D != null) {
                var s = triggerBoxCollider2D.size;
                s.x = 0.6f;
                triggerBoxCollider2D.size = s;
            }
        }

    }
}

